using UnityEngine;

public class HighlightLayer : MonoBehaviour
{
	public HighlightDisplayObject displayObject;

	public UIWidget highlight;

	public UIWidget pointer;

	public static HighlightLayer instance { get; protected set; }

	private void Awake()
	{
		instance = this;
	}

	private void OnDestroy()
	{
		instance = null;
	}

	public void ShowHighlight(UIWidget highlightItem, UIWidget highlightWidget)
	{
		highlight.width = highlightWidget.width + 20;
		highlight.height = highlightWidget.height + 20;
		highlight.transform.position = highlightWidget.transform.position;
		Vector3 zero = Vector3.zero;
		zero.y += (highlightWidget.height + pointer.width) / 2 + 10;
		pointer.transform.localPosition = zero;
		displayObject.itemToHighlight = highlightItem;
		displayObject.highlightElement = highlightWidget;
		NavigationManager.instance.PushModal(displayObject.gameObject);
	}
}
